//
//  UIFont+Extension.m
//  MiaMind
//
//  Created by Vill on 2023/11/27.
//

#import "UIFont+Extension.h"

@implementation UIFont (Extension)

/**
 苹方字体

 @param fontWeight 字体粗细（字重)
 @param fontSize 字体大小
 @return 返回指定字重大小的苹方字体
 */
+ (UIFont *)fontWithWeight:(FontStyle)fontWeight size:(CGFloat)fontSize{
    NSString *fontName = @"PingFangSC-Regular";
    switch (fontWeight) {
        case Medium:
            fontName = @"PingFangSC-Medium";
            break;
        case Semibold:
            fontName = @"PingFangSC-Semibold";
            break;
        case Bold:
            fontName = @"PingFangSC-Bold";
            break;
        case Regular:
            fontName = @"PingFangSC-Regular";
            break;
        case MTBold:
            fontName = @"ArialRoundedMTBold";
            break;
    }
    UIFont *font = [UIFont fontWithName:fontName size:fontSize];
    return font ?: [UIFont systemFontOfSize:fontSize];
}

@end
